using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace Odb_base.Interop.Events
{
  [TypeLibType(TypeLibTypeFlags.FHidden), ClassInterface(ClassInterfaceType.None)]
  public sealed class DiscFormat2Data_SinkHelper : DDiscFormat2DataEvents
  {
    public DiscFormat2Data_SinkHelper(DiscFormat2Data_EventsHandler eventHandler)
    {
      if (eventHandler == null)
        throw new ArgumentNullException("Delegate (callback function) cannot be null");
      m_dwCookie = 0;
      m_UpdateDelegate = eventHandler;
    }

    public void Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender,
                       [In, MarshalAs(UnmanagedType.IDispatch)] object args)
    {
      m_UpdateDelegate(sender, args);
    }

    public int Cookie
    {
      get { return m_dwCookie; }
      set { m_dwCookie = value; }
    }

    public DiscFormat2Data_EventsHandler UpdateDelegate
    {
      get { return m_UpdateDelegate; }
      set { m_UpdateDelegate = value; }
    }

    private int m_dwCookie;
    private DiscFormat2Data_EventsHandler m_UpdateDelegate;
  }

  
}
